cmake_minimum_required(VERSION 3.5.0)
set(PROJECT_NAME example)
project(${PROJECT_NAME} VERSION 0.1.0)
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_CXX_STANDARD 14)

if(NOT DEFINED ENV{MACA_PATH})
    message(FATAL_ERROR "Please make sure the environment variable MACA_PATH is set. 
    using export MACA_PATH=/your/maca/path")
endif()

if (DEFINED ENV{MACA_CLANG_PATH})
    INCLUDE_DIRECTORIES($ENV{MACA_CLANG_PATH}/../lib)
else()
    message(FATAL_ERROR "\nthe env MACA_CLANG_PATH is not specified!")
endif()

INCLUDE_DIRECTORIES($ENV{MACA_PATH}/include/mcr)
INCLUDE_DIRECTORIES($ENV{MACA_PATH}/include/mcblas)
INCLUDE_DIRECTORIES($ENV{MACA_PATH}/include)
LINK_DIRECTORIES($ENV{MACA_PATH}/lib)

file(GLOB EXAMPLE_SRCS1 "example1.cpp")
file(GLOB EXAMPLE_SRCS2 "example2.cpp")

add_executable("example1" ${EXAMPLE_SRCS1})
add_executable("example2" ${EXAMPLE_SRCS2})

target_link_libraries("example1" mcblas mcruntime)
target_link_libraries("example2" mcblas mcruntime)
